package per.ethan.springboot.basic.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import java.time.LocalDateTime;

/**
 * @author Ethan
 * @date 2020/06/11 11:10
 */
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "用户信息", parent = BaseEntity.class)
public class User extends BaseEntity {

    /**
     *
     * 字段类型: varchar
     * 长度: 50
     */
    @ApiModelProperty(value = "用户名 字段类型: varchar 长度: 50")
    private String username;

    /**
     *
     * 字段类型: varchar
     * 长度: 100
     */
    @ApiModelProperty(value = "密码 字段类型: varchar 长度: 100")
    private String password;

    /**
     *
     * 字段类型: varchar
     * 长度: 50
     */
    @Email(message = "非法的电子邮件")
    @ApiModelProperty(value = "电子邮箱 字段类型: varchar 长度: 50")
    private String email;

    /**
     *
     * 字段类型: datetime
     */
    @ApiModelProperty(value = "生日 字段类型: datetime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime birthday;

}